package com.imporven.sell.service;

import com.imporven.sell.dto.OrderDTO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.Optional;

/**
 * @author imporven
 * @version 1.0.0
 * @date 2018-7-15 1:28
 */
public interface OrderService {
    /**
     * 下单入库
     * @param orderDto 订单
     * @return OrderDTO 订单
     */
    OrderDTO create(OrderDTO orderDto);

    /**
     * 查询订单列表
     * @param openid 用户openid
     * @param pageable 分页page
     * @return
     */
    Page<OrderDTO> findList(String openid, Pageable pageable);

    /**
     * 通过orderid查找订单
     * @param orderId 订单id
     * @return OrderDTO 订单信息
     */
    Optional<OrderDTO> findOne(String orderId);

}
